home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4918 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: news.halcyon.com!usenet
  2. From: normanb@halcyon.com (Norm Bryar)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Compile problem
  5. Date: Thu, 01 Feb 1996 16:47:58 GMT
  6. Organization: Northwest Nexus Inc.
  7. Message-ID: <4eqqr0$d8b@news.halcyon.com>
  8. References: <4eol9k$gqf@fred.uswnvg.com>
  9. NNTP-Posting-Host: blv-pm2-ip25.halcyon.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. It might mean that a variable was declared at a level of scope, but
  13. declared with an initialization that may never execute because of a
  14. break in the flow of control.  The compiler has problems making space
  15. on the stack and initializing that space in such cases, but I've no
  16. solid feel for why.   For example
  17.  
  18. void Un::Deux( int arg )
  19. {
  20.     switch( arg )
  21.     {
  22.         case 0:
  23.             int oopse=10;     // jump past initializer possible
  24.             ...
  25.             break;
  26.  
  27.         case 1:
  28.             int  fine;    // compiler makes room in switch scope
  29.             fine = 10;      // compiler can assign later
  30.             ...
  31.             break;
  32.  
  33.         case 2:
  34.             {    // new level of scope inside braces!
  35.                 int alsofine=10;    // no jumps in this set of { }? Ok.
  36.                 ...
  37.             }
  38.             break;
  39.         
  40.         ...
  41.     }    
  42. }
  43.  
  44. Bothersome, isn't it.  
  45.  
  46.                 --Norm
  47.  
  48. jweddle@uswnvg.com (Jacque Weddle) wrote:
  49.  
  50. >Hello,
  51.  
  52. >I'm a c person trying to compile some c++ code I got
  53. >off the net. I get the error message 
  54.  
  55. >"Log.cc", line 261: error: jump past initializer (did you forget a '{ }'?)
  56.  
  57. >I don't see a problem at the designated line number. Whats an
  58. >initializer?
  59. >I know this isn't much information but if someone could please 
  60. >tell me what kind of thing I should look for to fix this I'd much
  61. >appreciate it.
  62.  
  63. >TIA,
  64. >Jacque
  65.  
  66.  
  67.  
  68.